class Component {
    constructor(name, model, attributes) {
        this.name = name;               // 组件名称
        this.model = model;             // 三维模型（Three.js 对象）
        this.attributes = attributes;   // 组件属性
        this.behaviors = [];            // 行为列表
    }
    
    addBehavior(behavior) {
        this.behaviors.push(behavior);
        this.behaviors.sort((a, b) => a.priority - b.priority); // 按优先级排序
    }
    
    runBehaviors() {
        this.behaviors.forEach(behavior => behavior.execute());
    }
}

export default Component;


